﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using YTCMS.Services.Services;

namespace App.Areas.Wap.Controllers
{
    public class AdsController : Controller
    {
        public readonly IadsService _ads;
        public AdsController(IadsService ads)
        {
            this._ads = ads;
        }
        //
        // GET: /Ads/
        public ActionResult Index(string code)
        {
            var model = _ads.GetAsync(s => s.Code.Equals(code) && s.State == (int)YTCMS.Core.CommonState.正常);
            if (model == null)
                return Content("");
            else
            {
                return Content(model.Remark);
            }
        }
    }
}